package com.auditlog.boot.aop;

public class LogContextHolder {

    private static final ThreadLocal<LogContext> CONTEXT_HOLDER = ThreadLocal.withInitial(() -> new LogContext());

    public static LogContext get() {
        return CONTEXT_HOLDER.get();
    }

    public static void clear() {
        CONTEXT_HOLDER.remove();
    }

    public static boolean isAudit() {
        return get().isAudit();
    }
}


